﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Administrador/Site.Master" AutoEventWireup="true" CodeBehind="AltaUsuario.aspx.cs" Inherits="Smart_House_System.Formulario_web11" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2 id="myH2" style="margin-top:10%;">
        Alta Usuario
    </h2>
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
 <div>
     

    <asp:Accordion   
        ID="Accordion1"   
        CssClass="accordion"  
        HeaderCssClass="accordionHeader"  
        HeaderSelectedCssClass="accordionHeaderSelected"  
        ContentCssClass="accordionContent"   
        runat="server">  
    <Panes>  
        <asp:AccordionPane ID="AccordionPane1" runat="server" SelectedIndex="0" FadeTransitions="false"
                FramesPerSecond="40" TransitionDuration="250" AutoSize="None" RequireOpenedPane="false"
                SuppressHeaderPostbacks="false"> <%--runat="server"> --%> 
            <Header>Datos del cliente</Header>  
            <Content>  
        <table style="width: 100%;"  >
            <tr><td>&nbsp;</td></tr>
            <tr>
                <td style="text-align:right; width:45%;">
                    Nombre:</td>
                <td  style="text-align:left; width:55%">
                <asp:TextBox ID="txtNombre" runat="server" CssClass="myText"></asp:TextBox>
                    &nbsp;      
                    <asp:RequiredFieldValidator ID="rfvNombre" runat="server" 
                        ControlToValidate="txtNombre" ErrorMessage="*Nombre - Campo obligatorio" ForeColor="Red" Display="None"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr >
                <td style="text-align:right; width:45%">
                    &nbsp;
                    Apellido</td>
                <td style="text-align:left; width:55%">
                    <asp:TextBox ID="txtApellido" runat="server" CssClass="myText"></asp:TextBox>
                    &nbsp;      
                    <asp:RequiredFieldValidator ID="rfvApellido" runat="server" 
                        ControlToValidate="txtApellido" ErrorMessage="*Apellido - Campo obligatorio" ForeColor="Red" Display="None"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr >
                <td style="text-align:right; width:45%">
                    &nbsp;
                    Cedula</td>
                <td style="text-align:left; width:55%">
                    <asp:TextBox ID="txtCedula" runat="server" CssClass="myText" MaxLength="8"></asp:TextBox>
                    &nbsp;      
                    <asp:RequiredFieldValidator ID="rfvCedula" runat="server" 
                        ControlToValidate="txtCedula" ErrorMessage="*Cedula - Campo obligatorio" ForeColor="Red" Display="None"></asp:RequiredFieldValidator>
                     &nbsp;  
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"  ControlToValidate="txtCedula" ValidationExpression="^\d+$"
                        ErrorMessage="El campo debe contener 8 números"  ForeColor="Red"></asp:RegularExpressionValidator>

                </td>
            </tr>
            <tr >
                <td style="text-align:right; width:45%">
                    &nbsp;
                    Usuario</td>
                <td style="text-align:left; width:55%">
                    <asp:TextBox ID="txtUsuario" runat="server" CssClass="myText"></asp:TextBox>
                    &nbsp;      
                    <asp:RegularExpressionValidator ID="revUsuario" runat="server"
                       ErrorMessage="**Usuario - Minimo 8 caracteres."
                       ControlToValidate="txtUsuario" ForeColor="Red"
                       ValidationExpression="([a-zA-Z0-9]{8,30})$" Display="None" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="txtUsuario" ErrorMessage="*Usuario - Campo obligatorio" ForeColor="Red" Display="None"></asp:RequiredFieldValidator>
    <%--                <asp:RequiredFieldValidator ID="rfvUsuario" runat="server" 
                        ControlToValidate="txtUsuario" ErrorMessage="*Campo obligatorio" ForeColor="Red"></asp:RequiredFieldValidator>--%>
                </td>
            </tr>
            <tr >
                <td style="text-align:right; width:45%">
                    &nbsp;
                    Contraseña</td>
                <td style="text-align:left; width:55%">
                    <asp:TextBox ID="txtPassword" runat="server" CssClass="myText" TextMode="Password"></asp:TextBox>
                    &nbsp;      
    <%--                <asp:RequiredFieldValidator ID="rfvPassword" runat="server" 
                        ControlToValidate="txtPassword" ErrorMessage="*Campo obligatorio" ForeColor="Red"></asp:RequiredFieldValidator>--%>
                    <asp:RegularExpressionValidator ID="regexpName" runat="server"
                       ErrorMessage="*Contraseña - Ingresar entre 8 y 20 caracteres, conteniendo al menos un numero y un caracter, no acepta caracteres especiales"
                       ControlToValidate="txtPassword" ForeColor="Red" Display="None"
                       ValidationExpression="(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{8,20})$" />
                    <asp:RequiredFieldValidator ID="rfvPass" runat="server" 
                        ControlToValidate="txtPassword" ErrorMessage="*Contraseña - Campo obligatorio" ForeColor="Red" Display="None"></asp:RequiredFieldValidator>


                </td>
            </tr>
            <tr >
                <td style="text-align:right; width:45%">
                    &nbsp;
                    Rol</td>
                <td style="text-align:left; width:55%">
                    <div >
                       <select id="comboRol" class="styled-select" runat="server">
                          <option>Habitante Principal</option>
<%--                          <option>Habitante Secundario</option>
                          <option>Habitante Terciario</option>--%>
                       </select>
                    </div>
                </td>
            </tr>
            <tr><td>&nbsp;</td></tr>
        </table>

            </Content>  
        </asp:AccordionPane>  
        <asp:AccordionPane ID="AccordionPane2" runat="server">  
            <Header>Datos de la casa</Header>  
            <Content>  
                <table style="width: 100%;">
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align:right; width:45%">
                            Dirección
                        </td>
                        <td style="text-align:left; width:55%">
                            <asp:TextBox ID="txtDireccion" runat="server" CssClass="myText"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="rfvDireccion" runat="server" 
                                ControlToValidate="txtDireccion" ErrorMessage="*Dirección - Campo obligatorio" ForeColor="Red" Display="None"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="revDireccion" runat="server" ControlToValidate="txtDireccion"
                            ErrorMessage="No más de 50 Caracrteres" ForeColor="Red" ValidationExpression="^[A-Z a-z 0-9.,!@$ñÑá-ú#/]{0,50}"></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align:right; width:45%">
                            Foto
                        </td>
                        <td style="text-align:left; width:55%">
                            <asp:FileUpload ID="flpFoto" runat="server" />
                            <asp:RequiredFieldValidator ID="rfvFoto" runat="server" 
                                ControlToValidate="flpFoto" ErrorMessage="*Foto - Campo obligatorio" ForeColor="Red" Display="None"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align:right; width:45%">
                            Servicio
                        </td>
                        <td style="text-align:left; width:55%">
                            <asp:TextBox ID="txtServicio" runat="server" CssClass="myText"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="rfvServ" runat="server" 
                                ControlToValidate="txtServicio" ErrorMessage="*Servicio - Campo obligatorio" ForeColor="Red" Display="None"></asp:RequiredFieldValidator>
                        </td>
<%--                        <td style="text-align:right; width:45%">
                            Cedula Cliente
                        </td>
                        <td style="text-align:left; width:55%">
                            <asp:TextBox ID="txtCedula2" runat="server" CssClass="myText" ></asp:TextBox>
                        </td>--%>
                    </tr>
                </table>

            </Content>  
        </asp:AccordionPane>  
        <asp:AccordionPane ID="AccordionPane3" runat="server">  
            <Header>Planos de la casa</Header>  
            <Content>  
                <table style="width: 100%;">
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align:right; width:45%">
                            Casa
                        </td>
                        <td style="text-align:left; width:55%">
                            <asp:TextBox ID="txtIdCasa" runat="server" Visible="true" Enabled="false"></asp:TextBox>
                            <asp:TextBox ID="txtIdPlano" runat="server" Visible="false" Enabled="false"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align:right; width:45%">
                            Foto del Plano
                        </td>
                        <td style="text-align:left; width:55%">
                            <asp:FileUpload ID="fuPlano" runat="server" />
                            <asp:RequiredFieldValidator ID="rfvPlano" runat="server" 
                                ControlToValidate="fuPlano" ErrorMessage="*Foto Plano - Campo obligatorio" ForeColor="Red" Display="None"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </Content>  
        </asp:AccordionPane>  
    </Panes>  
    </asp:Accordion>  
    <div style="width=100%; text-align:center;" >
        <asp:Button ID="btnAgregarPlani" runat="server" Text="Agregar Plano" 
            onclick="btnAgregarPlani_Click" CssClass="agregarPlano"/>
    </div>
    <div style="width=100%; text-align:center;" >
        <asp:Label ID="lblMensaje" runat="server" Text="" Font-Size="Larger" ForeColor="Red"></asp:Label>
    </div>
    <div style="width=100%; text-align:center;" >
        <asp:ValidationSummary ID="ValidationSummary1" runat="server"  />
        <asp:Button ID="btnSiguiente" runat="server" Text="Siguiente"  
            CssClass="myButton" onclick="btnSiguiente_Click"/>  &nbsp;  &nbsp;
        <asp:Button ID="btnCancelar" runat="server" Text="Cancelar" CssClass="myButton" 
            onclick="btnCancelar_Click" CausesValidation="False" />
    </div>
 </div>

</asp:Content>
